﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IRongs.Wbt.Common.Auth
{

    /// <summary>
    /// Can be used to oauth and send oauthed requests to specifid server address.
    /// </summary>
    public interface IOAuthable : IRequestable
    {

        /// <summary>
        /// Gets the API's comsumer key, this is usually provided by API servicer.
        /// </summary>
        /// <value>The comsumer key.</value>
        string ConsumerKey { get; }

        /// <summary>
        /// Gets the API's consumer secret, this is usually provided by API servicer and work with <c>ConsumerKey</c> together.
        /// </summary>
        /// <value>The consumer secret.</value>
        string ConsumerSecret { get; }

        /// <summary>
        /// Gets the access token, this is the token which can be used to:
        ///     1. Request for the verifier key.
        /// Token can be retrieved from the REQUEST_TOKEN action.
        /// </summary>
        /// <value>The token.</value>
        string Token { get; }

        /// <summary>
        /// Gets the access token secret, this is the token which can be used to:
        ///     1. Request for the verifier key.
        /// Token secret can be retrieved from the REQUEST_TOKEN action, which appears together with Token.
        /// </summary>
        string TokenSecret { get; }

        /// <summary>
        /// Gets the verifier that can be retrieved from the ACCESS_TOKEN, which is used to verify wether the caller is valid.
        /// </summary>
        /// <value>The verifier.</value>
        string Verifier { get; }

        /// <summary>
        /// Gets the request token URL.
        /// </summary>
        /// <value>The request token URL.</value>
        string RequestTokenUrl { get; }

        /// <summary>
        /// Gets the authorize URL.
        /// </summary>
        /// <value>The authorize URL.</value>
        string AuthorizeUrl { get; }

        /// <summary>
        /// Gets the access token URL.
        /// </summary>
        /// <value>The access token URL.</value>
        string AccessTokenUrl { get; }

        /// <summary>
        /// Gets the request token.
        /// </summary>
        /// <returns>The Url to get do secure authentication.</returns>
        string GetRequestToken();

        /// <summary>
        /// Gets the access token.
        /// </summary>
        /// <param name="verifier">The verifier.</param>
        void GetAccessToken(string verifier);

        string UserId { get; }
    }
}
